package com.guodexian.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;
/**
 * 类说明：<br>
 *
 * @author qfrx<br>
 * 2024/12/24 16:36<br>
 * @since 1.0 <br>
 */
@Configuration
@ComponentScan("com.guodexian")
@EnableTransactionManagement//启用注解性事务
public class AppConfig {
    @Bean
    public TransactionManager transactionManager(DataSource dataSource) {
        return new DataSourceTransactionManager(dataSource);
    }
}
